import Vue from 'vue';
import locale from 'element-ui/lib/locale';
import VueI18n from 'vue-i18n';
import store from "@/store";
import en from './langs/en';
import zh from './langs/zh';

Vue.use(VueI18n);
const i18n = new VueI18n({
    locale: store.getters.localizeLang || 'zh',
    messages: {
        zh, //中文
        en, //英文
    }
});

locale.i18n((key, value) => i18n.t(key, value)); //重点：为了实现element插件的多语言切换

export default i18n;